<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/door/door.js"></script>
		<title>设置门控制参数</title>
	</head>
	<body>
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div  class="toolbar-panel ">
				<div class="toolbar-box">
					<div class="toolbar-head clearfix">
						<!-- 顶部按钮 -->
						<div class="buttons"> 		
							<a href="javascript:void(0);" class="btn btn-primary fa" id="checkParam"  onclick ="checkParam();" ><span>设置</span></a>
						</div>
						<!-- 收缩 -->
						<div class="tools">
							<a href="javascript:void(0);" class="collapse">
								<i class="bigger-180 fa  fa-angle-double-up"></i>
							</a>
						</div>
					</div>
					<!-- #查询条件-->
					<div class="toolbar-body" >
						<form role="form" class="search-form">
							<div  class="form-inline p-xxs">
								<div class="form-group">
									<label   class="search-label">控制器序列号</label>:
									<input type="text"  name="sn"  id="sn" class="form-control"   value="433108765"/>
								</div> 
								<!-- <div class="form-group">
									<label   class="search-label">端口号</label>:
								<input type="text"  name="port"  id="port" class="form-control" value="6000" />
								</div> 
								<div class="form-group">
									<label   class="search-label">IP地址</label>:
									<input type="text"  name="ipaddress"  id="ipaddress" class="form-control" value="192.168.0.190" />
								</div>  -->
								<div class="form-group">
									<label   class="search-label">门号</label>:
									<input type="text"  name="doornum"  id="doornum" class="form-control"  value="1"/>
								</div> 
								
								<div class="form-group">
									<label   class="search-label">控制方式</label>:
									<input type="text"  name="contrfs"  id="contrfs" class="form-control"  value="3" />
								</div>
								
									<div class="form-group">
									<label   class="search-label">开门延时</label>:
									<input type="text"  name="kmys"  id="kmys" class="form-control"   value="1"/>
								</div>
								
							</div> 
						</form>
					</div><!--/ 查询条件-->
				</div>
			</div><!--/ 操作、查询-->
			<div class="jqGrid_wrapper">
			
			</div>
		</div>
	<script type="text/javascript">
	
	
	 function checkParam(){	
		 //获取显示的记录
		    //发送ajax请求
		     //alert("获取门控制参数");
        _ctx="http://192.168.0.190:8025";
		 //获取参数
         	  sn=$("#sn").val();
         	// port=$("#port").val();
         	//ipaddress=$("#ipaddress").val();
         	doornum=$("#doornum").val();
         	contrfs=$("#contrfs").val();
         	kmys=$("#kmys").val();
         	 //调用接口获取设置门参数
         	  $.ajax({
		    	         	type: "GET",
		    	         	   url: _ctx+"/setDoorMessage?sn="+sn
		    	         			  // +"&port="+port+
		    	         			   //"&ipaddress="+ipaddress
		    	         			                                     +"&door="+doornum
		    	         			                                     +"&controller="+contrfs
		    	         			                                     +"&opendelay="+kmys
		    	         			                                     ,
		    	         	  async: false,//使用同步操作，否则init方法执行时setting可能还未被赋值
		    	         	  success: function(data) {
		    	         		  console.log(data);
		    	         		    if(data.code==200){
		    	         		    
		    	         		    	 alert("设置门控制参数成功！");
		    	         		    	
		    	         		    }else{
		    	         		    	alert("设置门控制参数异常！");
		    	         		    }
		    	         	        
		    	         	 },
		    	         	 error: function(){
		    	         		  alert("设置门控制参数失败！");
		    	              }
		    	         	 
		    	         	 });  
		    	         	 //end
		    	         	 
 }
	
	
	</script>
	</body>
	
</html>